'use strict';

module.exports = function(grunt){

	require('load-grunt-tasks')(grunt);

	grunt.initConfig({

		pkg: grunt.file.readJSON('package.json'),

		connect: {

			options: {
				port: 9001,
				hostname: "*",
				livereload: 35729
			},

			server: {
				options: {
					base: '',
					open: true
				},
			},
		},

		uglify: {
			dist: {
				options: {
					banner: '/**\n<%= pkg.name %> \nversion: <%=pkg.version %>\nauthor: <%=pkg.author %>\nrepository: <%=pkg.repository.url %>\n**/\n'
				},
				files: {
					'dist/jquery-simple-confirm.min.js': ['src/jquery-simple-confirm.js']
				}
			}
		},

		clean: {
			dist: 'dist'
		},

		watch: {
			livereload: {
				options: {
					livereload: '<%=connect.options.livereload %>'
				},
				files: ['index.html', 'src/*.js']
			},
			files: ['index.html', 'src/*.js']
		},

	});

	grunt.registerTask('serve', ['connect', 'watch:livereload']);


};
